package com.coolH.service.serviceImpl;

import com.coolH.dao.ImgMapper;
import com.coolH.entity.Img;
import com.coolH.service.ImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by hbl on 2017/6/2.
 */
@Service("ImgService")
public class ImgServiceImpl implements ImgService{
    @Autowired
    ImgMapper imgMapper;
    @Override
    public void addImg(Img img) {
        imgMapper.insert(img);
    }

    @Override
    public Img selectImg(Integer userId) {
        Img img = imgMapper.selectByUserId(userId);
        return img;
    }

    @Override
    public void updateImg(Img img) {
        imgMapper.updateByPrimaryKeySelective(img);
    }
}
